import React, { Component } from 'react';
import { messages } from "share/common";
import { Form, Input, Switch } from 'antd';
import InputLanguage from 'components/template/input-language'
const FormItem = Form.Item;

class DepartmentGroupDetailHead extends Component {

  render() {
    const { getFieldDecorator, getFieldValue } = this.props.form;
    const { head: { id } } = this.props;
    return (
      <div className='new-form-part'>
        <FormItem label={messages('common.column.status')/*状态*/} {...this.formItemLayout}>
          {getFieldDecorator('enabled', {
            valuePropName: 'checked',
            initialValue: true
          })(
            <Switch/>
          )}
        </FormItem>
        <div className="sub-title">
          {messages('common.baseInfo')/*基本信息*/}
        </div>
        <br/>
        <FormItem
          label={messages('basic-5.key802')/*部门组编码*/}
          {...this.formItemLayout}
          extra={messages('basic-5.key803')/*注：部门组编码保存后将不可修改*/}
        >
          {getFieldDecorator('deptGroupCode', {
            rules: [{
              required: true,
              message: messages('common.please.input')/*请输入*/,
            }]
          })(
            <Input disabled={!!id}/>
          )}
        </FormItem>
        <FormItem label={messages('basic-5.key804')/*部门组名称*/} {...this.formItemLayout} required>
          {getFieldDecorator('nameI18n', {
            rules: [InputLanguage.required]
          })(
            <InputLanguage />
          )}
        </FormItem>
      </div>
    )
  }
}

export default DepartmentGroupDetailHead;

